package cn.ac.sec.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;

import cn.ac.sec.model.User;
import cn.ac.sec.service.UserService;

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;
	
	@PostMapping("/userData")
	public String demo() {
		User user = userService.getUserByUserName("admin");
		return JSON.toJSONString(user);
	}
	
}
